namespace Digitalmes.Domain.Sys;

/// <summary>
/// 工作流
/// </summary>
[SugarTable("sys_workflow", "工作流")]
public class SysWorkflow : EntityTenantBase
{
    /// <summary>
    /// 流程类型
    /// </summary>
    [SugarColumn(ColumnDescription = "流程类型", Length = 32)]
    public long TypeId { get; set; }

    /// <summary>
    /// 类型信息
    /// </summary>
    [NotNull]
    [Navigate(NavigateType.OneToOne, nameof(TypeId))]
    public SysCode? TypeCode { get; set; }

    /// <summary>
    /// 流程名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "流程名称", Length = 255)]
    public string? Title { get; set; }

    /// <summary>
    /// 图标
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "图标", Length = 64)]
    public string? Icon { get; set; }

    /// <summary>
    /// 审批被拒后状态
    /// </summary>
    [SugarColumn(ColumnDescription = "审批被拒后状态")]
    public int Refused { get; set; } = 1;

    /// <summary>
    /// 状态
    /// </summary>
    [Required]
    [SugarColumn(ColumnDescription = "状态")]
    public bool Status { get; set; } = true;

    /// <summary>
    /// 流程说明
    /// </summary>
    [SugarColumn(ColumnDescription = "流程说明", Length = 256)]
    public string? Summary { get; set; }

    /// <summary>
    /// 具体流程Json
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "具体流程Json", Length = 4096)]
    public string? Flow { get; set; }
}